-
Notifications
You must be signed in to change notification settings - Fork 0
Improve organization #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iAmGiG
wants to merge
72
commits into
ChrisEvalBranch01
Choose a base branch
from
improve-organization
base: ChrisEvalBranch01
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Additional ideas
…ports and fix unused variables - Refactored the MentalHealthChatbot class: - Added absl-py for command-line argument handling. - Incorporated Sentence-BERT for query encoding and classification. - Added logistic regression for query categorization (informational vs emotional). - Implemented KNN for informational responses. - Integrated LinearSVC for emotion classification in emotional support queries. - Improved docstrings across all methods: - Clarified method roles, input arguments, return values, and attributes. - Added detailed explanations for the purpose and handling of unused variables like 'distances'. - Updated LinearSVC-related docstring with classifier usage and purpose. - Imported missing dependencies: - Added 'precision_recall_fscore_support' from sklearn.metrics. - Added 'LinearSVC' from sklearn.svm. - Enhanced modular design: - Incorporated best practices by organizing methods into logical segments. - Added error handling and console flag management with absl-py. - Removed or clarified unused variables: - Explained 'distances' in get_informational_response if retained or removed when unnecessary. - Structured code for better maintainability and future enhancements. - Added instructions in README for setup, including Conda and venv, and running the chatbot. Each method now has clear docstrings that explain its purpose, the arguments it takes, and the expected return values. Additional clarifications and reasoning have been added to provide context for unused variables like distances. Methods are ordered sequentially, starting from initialization (__init__) to the main execution (run).
Includes cache directories, virtual environments (venv, env), build files, and logs. VS/VSCode files: Adds .vs/, .vscode/, .idea/, and other Visual Studio-specific files like .suo, .sln.docstates. Data and Environment files: To prevent sensitive data or local configurations from being committed (like .env files). MacOS and Jupyter files: Excludes .DS_Store (macOS) and Jupyter checkpoint files.
repository’s history, but they remain on your local machine. Going forward, these files will be ignored thanks to the .gitignore file, so they won’t be accidentally committed again.
and update chatbot accordingly - Created 'canned_responses.csv' in the data directory with expanded responses. - Modified __init__ method to accept canned_responses_path and load responses from CSV. - Added 'load_canned_responses' method to read canned responses into a dictionary. - Updated 'get_emotional_response' to use the loaded canned responses. - Updated main.py and README.md to include the new command-line flag for canned responses path. - Ensured that the chatbot handles emotions not present in the canned responses gracefully.
Moved the csv file into a data folder "updated" Project strucutre.graphql - improving accuracy. updated readme updated mental_health_chatbot.py
Midterm checkpoint progression
documentation, and improve runtime logic - **Refactor MentalHealthChatbot class**: - Moved the 'run' method out of the class and into 'conversation_chatbot_main.py' to follow best practices. - Updated imports in the new 'conversation_chatbot_main.py' file for better modularity. - Updated class method variable names to conform to snake_case naming style in 'load_data', 'preprocess_data', 'train_logistic_classifier', 'build_knn_classifier', and 'get_informational_response'. - Removed dependency on 'data/canned_responses.csv' and incorporated conversation graphs for emotional queries based on the mental health counseling conversations dataset. - **Enhance chatbot interaction**: - Expanded termination options in the interactive loop to include 'exit', 'quit', 'q', 'x', 'e', and 'Ctrl+C' for graceful exits. - **Update project documentation**: - Updated README running instructions to reflect changes in module names and data paths. - Added project structure section to README with descriptions of key files and directories. - Provided a module docstring for 'conversation_chatbot_main.py' detailing the purpose and usage of the script. - Updated the project’s structure in GraphQL format to better reflect the file organization. - **Future-proofing**: - Set up a clear separation of concerns between chatbot logic and runtime flow to improve maintainability and reusability. - Prepared the project for future improvements by updating docstrings, adhering to coding best practices, and documenting all key functionality. This commit includes all updates made during the conversation, enhancing the overall structure, usability, and clarity of the chatbot project.
removed pycache removed cannded response .csv moved test.csv into data - remove later updated readme.md to have the proper name.
corrected the README.md filename updated project structure.
Added a new class for emotional response.
Refactor, Documentation Updates, and Runtime Enhancements
organized the imports, and perfromed linting.
Refactor And Integration of Emotional_Response.
- Refactored MentalHealthChatbot class: - Removed `train_emotion_classifier` and all `LinearSVC` dependencies, replacing them with the new `EmotionalResponse` class for emotional query handling. - Integrated `EmotionalResponse.get_response` method for emotional queries in `respond_to_query`. - Simplified data loading to include only FAQ and counseling conversation datasets. - depricated get emotional response, train emotional classifier methods. - Updated conversation_chatbot_main.py runtime: - Adjusted `conversations_data_path` to use the Hugging Face dataset URL for real-time access to counseling conversations. - Removed unnecessary method calls (e.g., `train_emotion_classifier`) to align with updated class structure. - Enhanced exit options and user guidance in the interactive loop for better usability. - Added detailed docstrings and comments: - Documented major methods and clarified logic in both `MentalHealthChatbot` and `conversation_chatbot_main.py`. - Provided additional instructions on response handling and runtime behavior. - Future Enhancements: - Outlined the need for integrating summarization in `EmotionalResponse` for a more refined response structure. This refactor prepares the chatbot for streamlined conversational flow and enables multi-turn interactions based on real counseling data.
and update classes - Check for CUDA availability and GPU count in conversation_chatbot_main.py - Update MentalHealthChatbot and EmotionalResponse classes to accept a device parameter - Automate device assignment and model loading onto the specified device - Implement robust error handling and logging - Ensure compatibility with pre-trained models from HuggingFace
…rials in spreadsheet.
Branch clean up
Merge pull request #8 from nverma42/main
many files where outside of folders including Depricated_Files
Pipeline md isn't using the current updated formate as modified
previously
fixed snake case of Model_Comparison filename
moved Visuals into respective folder
metrics moved into Metrics folder
removed protject structure graphql - depricated
moved MentalHealthChatbotCodeDocument into Depricated_Files but might
revive
that implements the MMR-based. Here are the key improvements and features: Sentence Transformer Integration: Uses the sentence-transformers library for high-quality sentence embeddings Configurable model selection (defaults to 'paraphrase-MiniLM-L6-v2') GPU support through device parameter MMR Algorithm Implementation: Implements Maximal Marginal Relevance as specified Configurable λ parameter (default 0.7) Balances relevance to query with diversity in selected sentences Enhanced Sentence Processing: Improved sentence splitting with abbreviation handling Maintains sentence ordering as specified Returns original indices for traceability Rich Output: Returns detailed metadata about the summarization process Includes similarity scores and selected indices Error handling with informative messages
Summarization engine v2 with cleanup
summarization_engine_V2 was appart of a cherry-pick from another branch, fishing the merge with a removal.
…en, added these to gitignore.
…ng process for both single and multi-GPU setups Updated all methods that use encoding to use the new wrapper method Maintained the original SentenceTransformer instance as base_encoder
…proper device management Added batch processing for large datasets to prevent memory issues Added proper error handling for out-of-memory scenarios Improved device handling with proper type checking Added memory cleanup when needed Improved initialization with proper placeholder setup
Added proper device handling and conversion Created a new encode_text method with: Batch processing support Better error handling Memory management Proper device fallback Improved error handling in get_response Added more empathetic default responses Better handling of edge cases The file also needs a few imports at the top
removed duplicate lines. update doc strings for methods.
Testing a commit message
Major restructuring of the codebase for better maintainability and professional presentation: **Repository Structure:** - Move core modules to src/ directory with proper package structure - Organize tests in tests/ directory with comprehensive test coverage - Create scripts/ directory for utility and analysis tools - Establish docs/ directory for documentation - Add setup.py for pip-installable package **Documentation Improvements:** - Comprehensive rewrite of Pipeline.md with detailed technical specifications - Enhanced README.md with feature highlights and improved setup instructions - Added technical details for MMR summarization algorithm - Documented conversation graph architecture and LDA topic modeling **Code Organization:** - Remove deprecated files and consolidate functionality - Update .gitignore with comprehensive coverage for Python projects - Clean up legacy visualization files and unused test modules - Maintain backward compatibility while improving structure This reorganization establishes a professional foundation for future development and makes the project more accessible to contributors.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Minor File reorganization.